<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link href="../../../element/index.css" rel="stylesheet" />
		<script src="../../../js/vue.js"></script>
		<script src="../../../element/index.js"></script>
		<script src="../../../js/axios.js"></script>
		<script src="../../../js/gsaucommon.js"></script>
		<style>
			#app {
				width: 1200px;
				margin: 0px auto;
				padding: 0px;
				/* box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1) */
				/* border: 1px ; */
				box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)
			}

			.el-input {
				width: 280px;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
			}

			.el-form label {
				display: inline-block;
				font-size: 20px;
				width: 280px;
				border-radius: 30px;
				border: 3px solid #dbdbdb;
				/* background-color: #808080; */
			}

			.el-input__inner {
				border-bottom: 3px solid #dbdbdb;
				border-top:0px;
				border-left:0px;
				border-right:0px;
				text-align: left;
				font-size: 25px;
			}

			.d2 li {
				list-style: none;
			}

			.lyric-enter,
			.lyric-leave-to {
				opacity: 0;
				transform: translateY(10px);
			}

			.lyric-enter-to,
			.lyric-leave {
				opacity: 1;

			}

			.lyric-enter-active,
			.lyric-leave-active {
				transition: all 0.7s;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<div id="" style=" position: sticky; z-index: 2; top: 0px; background-color: white;">
				<el-row>
					<el-col :span="12" style="padding-left: 80px;">
						<h3>审核</h3>
					</el-col>
					<el-col :span="12" style="text-align: right; padding-top: 15px; padding-right: 80px; ">
						<el-button type="primary" @click="fanhui">
							返回
						</el-button>
					</el-col>
				</el-row>
				<hr  />
			</div>

			<el-form ref="form" label-width="180px">
				<el-row style="margin-top: 30px;">
					<el-row>
						<el-col :span="24">
							<el-form-item label="项目名称:">
								<el-input v-model="form.projectName" readonly style="width: 100%;"></el-input>
							</el-form-item>
							<!-- 跟具自己的修改 可修改为 项目名称 书名 荣誉称号 竞赛名称 专利或软件著作权名称-->
						</el-col>
					</el-row>

					<el-row>
						<el-col :span="24">
							<el-form-item label="填写人姓名:">
								<el-input v-model="form.tianbaoName" readonly></el-input>
							</el-form-item>
						</el-col>
					</el-row>

					<el-row>
						<el-col :span="12">
							<el-form-item label="主持人:">
								<el-input v-model="form.zhuChiRen" readonly></el-input>
								<!-- 跟具自己的修改可修改为 奖项名称 出版社 组织单位 主持人 专利/软著号  -->
								<!-- 荣誉称号的可以删除此item -->
							</el-form-item>
						</el-col>
					</el-row>


					<el-row>
						<el-col :span="24">
							<el-form-item label="立项单位:">
								<el-input v-model="form.lixiangDanWei" readonly></el-input>
								<!-- 仅获奖情况、科研（立项单位）的保留 -->
							</el-form-item>
						</el-col>
					</el-row>

					<el-row>
						<el-col :span="12">
							<el-form-item label="参加人数:">
								<el-input v-model="form.zongRenShu" readonly></el-input>
								<!-- 仅获奖情况的保留 -->
							</el-form-item>
						</el-col>

						<el-col :span="12">
							<el-form-item label="本人排名:">
								<el-input v-model="form.meSort" readonly></el-input>
								<!-- 仅获奖情况的保留 -->
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="12">
							<el-form-item label="获批经费(万元):">
								<el-input v-model="form.huoPiJingFei" readonly></el-input>
								<!-- 仅获奖情况的保留 -->
							</el-form-item>
						</el-col>

						<el-col :span="12">
							<el-form-item label="到账经费(万元):">
								<el-input v-model="form.daoZhangJingFei" readonly></el-input>
								<!-- 仅获奖情况的保留 -->
							</el-form-item>
						</el-col>
					</el-row>
					<el-col :span="24">
						<el-form-item label="提交人:">
							<el-input v-model="form.updateBy" readonly></el-input>
							<!-- 仅获奖情况的保留 -->
						</el-form-item>
					</el-col>

					<el-col :span="12">
						<el-form-item label="提交时间:">
							<el-input v-model="form.createTime" readonly></el-input>
							<!-- 仅获奖情况的保留 -->
						</el-form-item>
					</el-col>

					<el-col :span="12">
						<el-form-item label="更新时间:">
							<el-input v-model="form.updateTime" readonly></el-input>
							<!-- 仅获奖情况的保留 -->
						</el-form-item>
					</el-col>
					<el-col :span="12">
						<el-form-item label="审批负责人:">
							<el-input v-model="form.manager" readonly></el-input>
							<!-- 仅获奖情况的保留 -->
						</el-form-item>
					</el-col>

					<el-col :span="12">
						<el-form-item label="当前状态:">
							<el-input v-model="form.status" readonly></el-input>
							<!-- 仅获奖情况的保留 -->
						</el-form-item>
					</el-col>

					<el-col :span="24">
						<el-form-item label="认证材料:">
							<el-input type="button" v-model="pleaseClick" @click.native="showcont2"></el-input>
						</el-form-item>
					</el-col>


					<el-col :span="12">
						<el-collapse-transition>
							<div v-show="show2" class="d2">
								<ul style="text-align: left;">
									<li v-for="(item,index) in cailiao" style="padding-left: 80px;"><i class="el-icon-document"></i>
										<el-link :href="'http://localhost:8080/files/'+item.fileFullPath">{{item.fileName}}</el-link>
									</li>
								</ul>
							</div>
						</el-collapse-transition>
					</el-col>

					<el-col :span="24">
						<el-form-item label="审批流程:">
							<el-input type="button" v-model="pleaseClick" @click.native="showcont1"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="12">
						<el-collapse-transition>
							<div class="block" v-show="show" style="padding-left: 80px;">
								<el-timeline>
									<el-timeline-item v-for="(item,index) in liucheng">
										<el-card>
											<h4>提交人:</h4>{{item.tijiaoName}}
											<h4>提交时间:</h4>{{item.tijiaoTime}}
											<h4>提交请求:</h4>{{item.tijiaoMemo}}
											<h4>审核人:</h4>{{item.shenHeName}}
											<h4>审核时间:</h4>{{item.shenHeTime}}
											<h4>审核结果:</h4>{{item.shenHeResult}}
										</el-card>
									</el-timeline-item>
								</el-timeline>
							</div>
						</el-collapse-transition>
					</el-col>
					<el-col :span="24">
						<el-form-item label="审核意见:">
							<el-input type="textarea" v-model="form.shenHeYiJian" style="width: 400px;"></el-input>
						</el-form-item>
					</el-col>
									
					<el-col :span="8">
						<el-form-item label="审核结果:">
							<el-switch style="display: block;margin-top: 10px;margin-left: 5px;" v-model="shenHeStatus" 
								active-color="#13ce66" inactive-color="#ff4949" active-text="通过" inactive-text="未通过" active-value="通过" inactive-value="未通过">
							</el-switch>
						</el-form-item>
					</el-col>
						<el-col :span="24" style="text-align: center;margin-bottom: 25px;">
						<el-button type="primary" style="width: 120px; height: 60px;" @click="submit">审核</el-button>
					</el-col>
				</el-row>
			</el-form>
		</div>
	</body>
</html>
<script>
	let vm = new Vue({
		el: "#app",
		data: {
			id:"",
			formData:"",
			form: {
				zhuChiRen: '',
				projectName: '',
				lixiangDanWei: '',
				lixiangDate: '',
				zongRenShu: '',
				meSort: '',
				huoPiJingFei: '',
				daoZhangJingFei: '',
				tianbaoName:'',
				updateTime:'',
				createTime:'',
				status:'',
				manager:'',
				shenHeStatus:"",
				shenHeYiJian:''
			},
			shenHeStatus:"",
			activeName: 'second',
			show: false,
			show2: false,
			value: "",
			liucheng:"",
			cailiao: [
				
			],
			data:{
				
			},
			config:{
				headers: {
					"token": ""
				}
			},
			pleaseClick: "点击显示",
		},
		methods: {
			find:function(id){
				axios(window.gsau+"jiaogai/searchbyjiaogaiid/"+id,this.config).then((res)=>{
					this.form=res.data.data
					console.log(this.form)
				})
			},
			findzhengmingcailiao:function(id){
				axios(window.gsau+"jiaogai/searchbymoduleidandrecoreid/"+id,this.config).then((res)=>{
					this.cailiao=res.data.data
				})
			},
			shneheluicheng:function(id){
				axios(window.gsau+"jiaogai/shenheluicheng/"+id,this.config).then((res)=>{
					console.log("*******************")
					console.log(res)
					console.log("*******************")
					this.liucheng=res.data.data
				})
			},
			showcont1: function() {
				this.show = !this.show;
			},
			showcont2: function() {
				this.show2 = !this.show2;
			},
			submit:function(){
				this.form.shenHeStatus=this.shenHeStatus
				axios.post(window.gsau+"jiaogai/shenpi",this.form,this.config).then((res)=>{
					if (res.data.code === 10010) {
						this.$alert('信息上报成功，请耐心等待审核', '审核成功', {
							confirmButtonText: '确定',
							callback: action => {
								this.$message({
									type: 'info',
									message: `审核成功`
								});
							}
						});
					} else {
						this.$alert('信息上报失败，请检查网络环境后重新添加', '审核失败', {
							confirmButtonText: '确定',
							callback: action => {
								this.$message({
									type: 'danger',
									message: `审核失败`
								});
							}
						});
					}
				})
				console.log(this.form)
			},
			fanhui:function(){
				window.location.href="jiaogailist.html"
			}
		},
		created: function() {
			this.config.headers.token = sessionStorage.getItem("token")
			this.id=localStorage.getItem("idplus")
			this.find(this.id)
			this.findzhengmingcailiao(this.id)
			this.shneheluicheng(this.id)
		},
	})
</script>
